package com.regentsoft.cloudback.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 报表返回公共类
 * @author czd
 * 
 * @since 2017年10月30日
 * 
 * @version v1.0
 *
 */
@ApiModel(description="报表返回公共类")
public class BasePageResp extends BaseResp{
	@ApiModelProperty(notes="总记录数",position=1)
	private int total;

	@ApiModelProperty(notes="总页数",position=2)
	private int totalPages;
	
	
	public BasePageResp() {
		
	}
	
	public BasePageResp(int pageNumber, int pageSize, int total) {
		this.total = total;
		if (total > 0 && pageSize > 0) {
			this.totalPages = (total - 1) / pageSize + 1;
			if (pageNumber > totalPages) {
				pageNumber = totalPages;
			}
		}
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}


	
	
}
